#!/usr/bin/env python
# -*- coding:utf-8 -*-

"""
@author zyx
@since 2022/2/27 17:55
@file: c02_mongo_quickstart.py
@desc: mongo入门案例
"""
import pymongo

conn = pymongo.MongoClient(
    host='127.0.0.1',
    port=27017
)

# 选择数据仓库
db = conn['sanqi']
# 获取表
table = db['stu']
# 查询数据
result = table.find()

for r in result:
    print(r)

conn.close()
